home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97b.txt
/
000097_icon-group-sender _Mon Oct 27 09:45:21 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
5KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id JAA00381
for <icon-group-addresses@cheltenham.CS.Arizona.EDU>; Mon, 27 Oct 1997 09:45:17 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA25702; Mon, 27 Oct 1997 09:45:17 -0700
To: icon-group@cs.arizona.edu
Date: Sat, 25 Oct 1997 16:03:48 +1000
From: Stuart.Robinson@anu.edu.au (Stuart Robinson)
Message-Id: <Stuart.Robinson-2510971603480001@asianstmg-229.anu.edu.au>
Organization: ANU
Sender: icon-group-request@cs.arizona.edu
References: <Stuart.Robinson-2410970146220001@asianstmg-229.anu.edu.au>, <Stuart.Robinson-2410971258070001@asianstmg-229.anu.edu.au>, <62p3uq$sup$1@vishnu.jussieu.fr>
Subject: Re: tabulating values
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
I got a number of useful responses. Thanks. Robert Clayton is especially
deserving of thanks, since he not only gave me a program, but explained
briefly how it works. (Teach a man to fish...)
I've also attached a rather rude reply sent by Gordon Peterson
<gep2@computek.net>. This typifies the sort of response I don't want! (By
the way, these queries are NOT an attempt to get others to do my homework
for me. I assume, though, that most people on the newsgroup never were
under this erroneous--and, I might add, uncharitable--assumption.)
===
From: gep2@computek.net
Date: Fri, 24 Oct 1997 12:54:16 -0500
Mime-Version: 1.0
Subject: Re: tabulating values
To: icon-group@cs.arizona.edu
X-Mailer: SPRY Mail Version: 04.00.06.17
Errors-To: icon-group-errors@cs.arizona.edu
X-UIDL: 3293cc176c97dbe60efef2aee9954237
> Well, I've now received six responses to my query, none of which provide a
solution to the problem.
Why are you asking those of us on the Net to do things for you which would
appear to be your homework assignments?
> I really do appreciate the responses, but four of the responses consisted of
people essentially saying "Heck, that's trivial" without proving it by actually
providing a working solution
It's NOT as if something so evident requires a "proof".
> and the two responses that did actually contain code failed to provide a
solution.
OK, let me give you a SNOBOL4/SPITBOL version of your "solution":
-plusops 1 ;* (for SNOBOL4+ only)
t = table()
rdrec line = input :f(donerd)
tabnum line span("0123456789") . n = :f(rdrec)
t[+n] = t[+n] + 1 :(tabnum)
donerd a = sort(t,1) :f(end)
output = "number count"
outlp output = rpad(a[(i = i + 1),1],9) a[i,2] :s(outlp)
end
The FACT, Stuart, is that my original post holds true. If you compare this
program against the word count program (which you will CERTAINLY find in the
Icon Program Library) you'll see that the technique used is essentially
identical, except that (1) one is spanning numeric characters instead of
alphabetic ones, and (2) the "+" used in front of the table index to make it
integer type rather than string type. This program (or one nearly
identical) is
probably an example program used in nearly every SNOBOL4/ICON book ever
published!!!
And with a fairly trivial upgrade to it it would also handle signed numbers and
decimal fractions, too.
But the bigger issue still remains: why do you think we should be doing
homework assignments for you, and why do you feel that we have to "prove"
anything at all to you? For you to even ASK here for such a trivial program is
to make it evident that you are unwilling (or unable) to pick up an Icon book
and READ it, or to give half a moment's effort to trying to learn how to use
this language. And either case is sad, because the language really is far too
useful and interesting for you to devote such a pathetically poor effort to
learning to use and understand it. (And besides, if you can't figure out the
beginning-level stuff like this, you're NEVER going to successfully finish your
later class assignments, anyhow, which will be complicated enough that you're
not going to find people here on the newsgroup who will post working-and-tested
solutions for you!).
Gordon Peterson
http://www.computek.net/public/gep2/
Support the Anti-SPAM Amendment! Join at http://www.cauce.org/
--
Stuart Robinson <Stuart.Robinson@nospam.anu.edu.au>
The Australian National University
*TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE